package com.viphuli.fragment;

import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.Bind;
import butterknife.OnClick;

import com.loopj.android.http.RequestParams;
import com.viphuli.app.R;
import com.viphuli.common.MyPageHelper;
import com.viphuli.http.ApiRequest;

/**
 * 订单详情
 * 
 * @author li.li
 *
 */
public class PurchaseOrderInfoFragment extends BaseProgressFragment {

	@Bind(R.id.id_main_content_service_company_order_id)
	protected TextView idText;

	@Bind(R.id.id_main_content_service_company_order_status)
	protected TextView statusText;

	@Bind(R.id.id_main_content_service_company_order_time)
	protected TextView timeText;

	@Bind(R.id.id_main_content_service_company_order_service_time)
	protected TextView serviceTimeText;

	@Bind(R.id.id_main_content_service_company_order_service_duration)
	protected TextView durationText;

	@Bind(R.id.id_main_content_service_company_order_name)
	protected TextView nameText;

	@Bind(R.id.id_main_content_service_company_order_pay)
	protected TextView payText;

	@Bind(R.id.id_main_content_service_company_order_site)
	protected TextView siteText;

	@Bind(R.id.id_main_content_service_company_order_phone)
	protected TextView phoneText;

	@Bind(R.id.id_main_content_service_company_order_ticket_title)
	protected TextView ticketTitleText;

	@Bind(R.id.id_main_content_service_company_order_ticket)
	protected TextView ticketText;

	@Bind(R.id.id_main_content_service_company_order_ticket_layout)
	protected ViewGroup ticketLayout;

	@Bind(R.id.id_main_content_service_company_order_pay_price_title)
	protected TextView payPriceTitleText;

	@Bind(R.id.id_main_content_service_company_order_pay_price)
	protected TextView payPriceText;

	@Bind(R.id.id_main_content_service_company_order_remark)
	protected TextView remarkText;

	@Bind(R.id.id_main_content_service_company_order_comment_btn)
	protected TextView commentBtn;

	private String orderId;

	@Override
	protected int obtainContentRes() {
		return R.layout.frag_order_info;
	}

	@Override
	protected void initParams() {

		Bundle args = getArguments();
		orderId = args.getString("order_id");

	}

	@Override
	protected void initView() {

	}

	@Override
	protected void initData() {

		RequestParams params = new RequestParams();
		params.put("order_id", orderId);

		ApiRequest.purchaseOrderInfo.request(this, params);

	}

	@OnClick(R.id.id_main_content_service_company_order_comment_btn)
	public void goToComment() {

		Bundle args = new Bundle();
		args.putString("order_id", orderId);
		MyPageHelper.purchaseOrderComment.showMyPage(getActivity(), args);

	}

	@OnClick(R.id.id_main_content_service_private_custom_reorder_btn)
	public void goToReOrder() {
		//		ViewUtils.toast("再次预订");
		PurchaseOrderFillFragment.go(getActivity(), orderId);
	}

	public TextView getIdText() {
		return idText;
	}

	public TextView getStatusText() {
		return statusText;
	}

	public TextView getTimeText() {
		return timeText;
	}

	public TextView getServiceTimeText() {
		return serviceTimeText;
	}

	public TextView getDurationText() {
		return durationText;
	}

	public TextView getNameText() {
		return nameText;
	}

	public TextView getPayText() {
		return payText;
	}

	public TextView getSiteText() {
		return siteText;
	}

	public TextView getPhoneText() {
		return phoneText;
	}

	public TextView getRemarkText() {
		return remarkText;
	}

	public TextView getCommentBtn() {
		return commentBtn;
	}

	public TextView getTicketTitleText() {
		return ticketTitleText;
	}

	public void setTicketTitleText(TextView ticketTitleText) {
		this.ticketTitleText = ticketTitleText;
	}

	public TextView getTicketText() {
		return ticketText;
	}

	public void setTicketText(TextView ticketText) {
		this.ticketText = ticketText;
	}

	public TextView getPayPriceTitleText() {
		return payPriceTitleText;
	}

	public void setPayPriceTitleText(TextView payPriceTitleText) {
		this.payPriceTitleText = payPriceTitleText;
	}

	public TextView getPayPriceText() {
		return payPriceText;
	}

	public void setPayPriceText(TextView payPriceText) {
		this.payPriceText = payPriceText;
	}

	public ViewGroup getTicketLayout() {
		return ticketLayout;
	}

	public void setTicketLayout(ViewGroup ticketLayout) {
		this.ticketLayout = ticketLayout;
	}

}
